package net.loststone

import grails.test.*

class IneServiceTests extends GrailsUnitTestCase {

  def ineService;

  protected void setUp() {
        super.setUp()
    }

  protected void tearDown() {
      super.tearDown()
  }

  public void testDate() {
    Date date = new Date();
    date.setMonth(11);
    // 2008 = 1900 + 108
    date.setYear(108);
    
    assertEquals(ineService.getIpcUrl(date),"http://www.ine.es/daco/daco42/daco421/ipc1108.xls");
    date.setMonth(3);
    date.setYear(98);
    assertEquals(ineService.getIpcUrl(date), "http://www.ine.es/daco/daco42/daco421/ipc0398.xls");
  }
   
}
